package 设计类和对象;

public class 设计我的对象 {
    public static void main(String[] args) {
        //类名+对象名=new 类名（）；
        Car c = new Car();//储存的是对象的地址
        System.out.println(c);//对象放在堆内存中
        c.name="奔驰Glc";
        c.price=100.8;
        System.out.println(c.name);
        System.out.println(c.price);
        c.start();
        c.run();
        Car c2 = new Car();
        c2.name="马萨拉蒂";
        c2.price=50.6;
        System.out.println(c2.name);
        System.out.println(c2.price);
        c2.start();
        c2.run();
    }
}
